package com.xinrui.sunnyday.service;

import com.github.pagehelper.PageInfo;
import com.xinrui.sunnyday.entity.QueryPageBean;
import com.xinrui.sunnyday.exception.SunnydayException;
import com.xinrui.sunnyday.pojo.CheckGroup;

import java.util.List;

public interface CheckGroupService {
    /**
     * 查询所有
     * @return
     */
    List<CheckGroup> findAll();

    /**
     * 分页查询
     * @param queryPageBean
     * @return
     */
    PageInfo<CheckGroup> findPage(QueryPageBean queryPageBean);

    /**
     * 添加
     * @param checkGroup
     * @param checkItemIds
     * @throws SunnydayException
     */
    void add(CheckGroup checkGroup, Integer[] checkItemIds) throws SunnydayException;

    /**
     * 查询检查组数据
     * @param id
     * @return
     */
    CheckGroup findGroupById(Integer id);

    /**
     * 查询检查组和检查项的中间表中检查组ids
     * @param id
     * @return
     */
    List<Integer> findGroupAndItemById(Integer id);

    /**
     * 编辑
     * @param checkGroup
     * @param checkItemIds
     * @throws SunnydayException
     */
    void update(CheckGroup checkGroup, Integer[] checkItemIds) throws SunnydayException;

    /**
     * 删除
     * @param id
     */
    void deleteById(Integer id) throws SunnydayException;

}
